package main
import (
	"fmt"
	"sort"
	"strings"
)
func FirstNotRepeatingChar( str string ) int {
	// write code here
	once := make(map[rune]int)
	for k, v := range str {

		if _, ok := once[v]; !ok && strings.LastIndex(str, string(v)) == k {
			return k
		}
		once[v] = 1
		fmt.Println(once)
	}
	fmt.Println(once)
	return -1
}


func ReverseSentence( ReverseSentence string ) string {
	// write code here
	sSlice := strings.Split(ReverseSentence, " ")
	fmt.Println(sSlice)
	res := ""
	for i := len(sSlice) - 1;i >= 0; i -- {
		res += sSlice[i]
		if i != 0 {
			res += " "
		}
	}
	return res
}

func IsContinuous( numbers []int ) bool {
	// write code here
	sort.Ints(numbers)
	count := 0
	for i := 0; i < len(numbers); i ++ {
		if numbers[i] == 0 {
			count ++
		}else {
			break
		}
	}
	if count == 4 {
		return true
	}
	index := count + 1
	for  j := count; j < len(numbers) - 1; j ++ {
		if numbers[j + 1] - numbers[j] == 1 || numbers[j + 1] - numbers[j] == count - 1 {
			index ++
			continue
		}
	}
	fmt.Println(index)
	if index == len(numbers) - 1 {
		return true
	}
	return false
}

func main(){
	// fmt.Println(FirstNotRepeatingChar("google"))
	//arr := make([]int, 5)
	//for i, _ := range arr {
	//	fmt.Scanf("%d", &arr[i])
	//}
	//fmt.Println(arr)

	fmt.Println(IsContinuous([]int{0,3,2,6,4}))
}
